﻿#region

using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Logging;
using Vin.Tool.AspNetCore.Singleton;
using Vin.Tool.Attributes;

#endregion

namespace Vin.Tool.AspNetCore.Service;

[Service]
public class VinBaseService
{
    protected ILogger Logger =>
        VinApp.GetRequiredService<ILoggerFactory>().CreateLogger(this.GetType());

    protected virtual string LoggerName => this.GetType().Name;

    public HttpContext HttpContext => VinApp.HttpContext;

    public VinBaseService()
    {
        VinApp.Inject(this);
    }
}